init();

function init() {
    queryApplyList();
}

function queryApplyList(pageIndex) {
    if (pageIndex == null) {
        pageIndex = 0;
    }
    var queryName = $("#queryName").val();
    $.ajax({
        url: prefixUrl + "apply/queryapply",
        type: "post",
        data: JSON.stringify({
            applyNo: queryName,
            applyName: queryName,
            applyCompanyName:queryName,
            pageIndex: pageIndex
        }),
        contentType: "application/json;",
        success: function (data) {
            var commonHtml = "";
            var list = data.data.rows;

            for (var i = 0; i < list.length; i++) {
                commonHtml = commonHtml + '<div class="tab-panel-item tab-active"><ul><li><div class="aui-list-title-info"><a href="javascript:;" class="aui-list-product-fl-item"><div class="aui-list-product-fl-text">'
                    + '<span class="aui-list-product-item-shop">'
                    + list[i].applyCompanyName
                    + '</span>'
                    + '<div class="aui-list-product-fl-mes"><div><span class="aui-list-product-item-price">编号：'
                    + list[i].applyNo
                    +'<br></span><span class="aui-list-product-item-price">名称：'
                    + list[i].applyName
                    +'</span></div>'
                    if(list[i].auditState == null ||　list[i].auditState == 0){
                        commonHtml = commonHtml + '<div class="aui-list-product-item-audit" style="padding-right: 50px;">待审核</div>';
                    }else if(list[i].auditState == 2){
                        commonHtml = commonHtml + '<div class="aui-list-product-item-yes" style="padding-right: 50px;">通过</div>';
                    }else if(list[i].auditState == 1 || list[i].auditState == 3){
                        commonHtml = commonHtml + '<div class="aui-list-product-item-no" style="padding-right: 50px;">未通过</div>';
                    }
                    commonHtml = commonHtml + '</div></div></a></div></li></ul></div>';
            }
            commonHtml = commonHtml + '</tbody>';
            $("#applyList").html(commonHtml);
        }
    })
}